12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- import clsx from "clsx";
- import { Viewport } from "next";
- import { NextIntlClientProvider } from "next-intl";
- import { getMessages } from "next-intl/server";
- import { Inter as FontSans } from "next/font/google";
- import { ReactNode } from "react";
- import "../globals.scss";
- import { Providers } from "./providers";
- // 加载字体
- const fontSans = FontSans({
- subsets: ["latin"],
- variable: "--font-sans",
- });
- export const viewport: Viewport = {};
- export const metadata = {
- keywords: ["Next.js"],
- description: "Next.js",
- appleWebApp: {
- statusBarStyle: "black",
- },
- formatDetection: {
- email: false,
- address: false,
- telephone: false,
- },
- referrer: "no-referrer",
- other: {
- viewport: [
- "width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0," +
- " viewport-fit=cover ",
- ],
- },
- };
- console.log(
- `🚀🚀🚀🚀🚀-> in layout.tsx on 38`,
- process.env.NODE_ENV,
- process.env.NEXT_PUBLIC_BASE_URL
- );
- export default async function LocaleLayout({
- children,
- params: { locale },
- }: {
- children: ReactNode;
- params: { locale: string };
- }) {
- const messages = await getMessages();
- return (
- <html lang={locale} suppressHydrationWarning>
- <body className={clsx("font-sans", fontSans.variable)}>
- <NextIntlClientProvider messages={messages}>
- <Providers themeProps={{ attribute: "class" }}>{children}</Providers>
- </NextIntlClientProvider>
- </body>
- </html>
- );
- }
|